home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / npns.lha / npns / src / CopyFile.c next >
C/C++ Source or Header  |  1996-05-06  |  850b  |  42 lines

  1.  
  2. /*
  3.  *    Function    CopyFile
  4.  *    Programmer    N.d'Alterio
  5.  *    Date        05/05/96
  6.  *
  7.  *  Synopsis:    Copy contents of one file to another, both files
  8.  *        should be open.
  9.  *
  10.  *  Arguments:    in_fptr            Input file pointer
  11.  *        out_fptr        Output file pointer
  12.  *
  13.  *  Returns:    None
  14.  *
  15.  *  Variables:    ch            Character buffer
  16.  * 
  17.  *  Functions:    fgetc            Get char (ANSI)
  18.  *        fputc            Put char (ANSI)
  19.  *
  20.  *  $Id: CopyFile.c 1.1 1996/05/06 22:55:02 nagd Exp $
  21.  *
  22.  */
  23.  
  24. #include <stdio.h>
  25.  
  26. void CopyFile( FILE *in_fptr, FILE *out_fptr )
  27.  
  28.                
  29.   int ch;
  30.  
  31.   while ( ( ch = fgetc( in_fptr ) ) != EOF ) fputc( ch, out_fptr );
  32.  
  33.   return;
  34.  
  35. }   /* end function CopyFile */
  36.  
  37. /*========================================================================*
  38.                             END FUNCTION CopyFile
  39.  *========================================================================*/
  40.  
  41.